package com.pengpeng.android.activity;


import android.app.Activity;
import android.os.Bundle;

import com.pengpeng.android.activity.R;
import com.pengpeng.android.dao.MapDao;
import com.pengpeng.android.entity.MapEntity;
import com.pengpeng.android.framework.SystemShareObjects;
import com.pengpeng.android.logic.init.Init_Map;
import com.pengpeng.android.logic.init.Init_ServiceThreadHandle;

public class InitActivity extends Activity {
    /** Called when the activity is first created. */
	private SystemShareObjects SObjContainer=null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.init);
        SObjContainer=SystemShareObjects.getInstance();
        loadService();
        loadMap();
        this.finish();
    }
     
    private void loadMap()
    {
    	MapDao mapdao=new MapDao();
    	MapEntity mapentity=mapdao.query();
    	mapdao.close();
    	
    	
        
        SObjContainer.setMapEntity(mapentity);
        
    	Init_Map mapmanager=new Init_Map();
    	mapmanager.loadMap(this);
    	
    }

	private void loadService()
	{
		Init_ServiceThreadHandle  servicethread=new Init_ServiceThreadHandle();
		Thread thread=new Thread(servicethread);
		thread.start();
	}
    
}